package com.onec.service.unsafe.lock;

import java.util.concurrent.locks.LockSupport;

public class LockSupportDemo {


  public static class ChangeObject extends Thread {

    public ChangeObject(String name) {
      super(name);
    }

    @Override
    public void run() {
      // 务先阻塞 不可中断
      java.util.concurrent.locks.LockSupport.park();
    }
  }

  public static void main(String[] args) {
    ChangeObject changeObject = new ChangeObject("测试线程");
    changeObject.start();
    // 解锁
    LockSupport.unpark(changeObject);

  }
}
